Better messages for add-key-val-to-alist
authorjustbur <justin@burkett.cc>
Sat, 19 Sep 2015 15:10:58 +0000 (11:10 -0400)
committerjustbur <justin@burkett.cc>
Sat, 19 Sep 2015 15:10:58 +0000 (11:10 -0400)
which-key.el

index 028a99629aaa19b7b75ce13eb7a8f55273741e8e..4bd59f572e68d905197fcc060ddfa06186617523 100644 (file)
@@ -497,12 +497,13 @@ bottom."
 (defun which-key--add-key-val-to-alist (alist key value)
   "Internal function to add (KEY . VALUE) to ALIST."
   (when (or (not (stringp key)) (not (stringp value)))
-    (error "KEY and VALUE should be strings"))
+    (error "which-key: Error %s (key) and %s (value) should be strings"
+           key value))
   (let ((key-lst (listify-key-sequence (kbd key))))
     (cond ((null alist) (list (cons key-lst value)))
           ((assoc key-lst alist)
-           (message "which-key: changing %s name from %s to %s"
-                    key (cdr (assoc key-lst alist)) value)
+           (message "which-key: changing %s name from %s to %s in %s"
+                    key (cdr (assoc key-lst alist)) value alist)
            (setcdr (assoc key-lst alist) value)
            alist)
           (t (cons (cons key-lst value) alist)))))